/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package engine165.renderSystem;

import graphicslib3D.*;
import helperClasses.Quaternion;

/**
 * Implements a Camera class
 * @author Matthew
 */
public class Camera 
{
    private Point3D location;
    private Quaternion orientation;
    
    /**
     * Creates a Camera to be used in a 3D world
     */
    public Camera() 
    {
        location = new Point3D();
        orientation = new Quaternion();
    }
    
    /**
     * Creates a Camera to be used in a 3D world
     * @param location Point3D that specifies where in the world the camera is located
     * @param orientation Quaternion that specifies the camera orientation
     */
    public Camera(Point3D location, Quaternion orientation)
    {
        this.location = location;
        this.orientation = orientation;
    }
    
    /**
     * Gets the location of the camera
     * @return
     */
    public Point3D getLocation()
    {
        return location;
    }
    
    /**
     * Sets the location of the Camera
     * @param location
     */
    public void setLocation(Point3D location)
    {
        this.location = location;
    }
    
    /**
     * Gets the orientation of the camera
     * @return a Quaternion that represents an orientation
     */
    public Quaternion getOrientation()
    {
        return orientation;
    }
    
    /**
     * Sets the orientation of the camera
     * @param orientation Quarternion that represents an orientation
     */
    public void setOrientation(Quaternion orientation)
    {
        this.orientation = orientation;
    }
    
    /**
     * Updates the orientation of the camera
     * @param incOrientation
     */
    public void updateOrientation(Quaternion incOrientation)
    {
        this.orientation.mult(incOrientation);
    }
    
    /**
     * gets the current angle axis representation of the camera's orientation
     * @return
     */
    public float[] getAngleAxis()
    {
        return this.orientation.getAngleAxis();
    }
}
